
    import React, { Component } from 'react'
    import {Modal,Form, Input} from 'antd'
    import PropTypes from 'prop-types'
    
    const Item = Form.Item

     class CheckCatorgray extends Component {
         static propTypes={
            categoryName: PropTypes.string, 
            setForm: PropTypes.func.isRequired,
         }

         UNSAFE_componentWillMount() { 
             this.props.setForm(this.props.form)
             }

        render() {
            const { getFieldDecorator} = this.props.form
            const { visible,onOk,onCancel,categoryName} = this.props
            
            return (
        <div>
            <Modal
            style={{
                width:'300px',
            }}
              title="添加分类"
              visible={visible}
              onOk={onOk}
              onCancel={onCancel}
            >
            <Form>
           
             <Item label="分类名称">
                 {
                     getFieldDecorator('categoryName',{
                         initialValue:categoryName
                     })(<Input placeholder='请输入分类名称'/>)
                 }
             </Item>
          
             </Form>
            </Modal>
        </div>
            )
        }
    }
    
    export default  Form.create()(CheckCatorgray)
